<template>
  <!-- 定义在这里的参数都是不可在外部覆盖的，防止出现问题 -->
  <j-select-biz-component
    :value="value"
    :ellipsisLength="25"
    :listUrl="url.list"
    :columns="columns"
    v-on="$listeners"
    v-bind="attrs"
    ref="selectComponent"
    v-if="selectComponentVisible"
  />
</template>

<script>
  import JSelectBizComponent from '@/components/jeecgbiz/JSelectBizComponent'
  export default {
    name: 'StdSelectMultiUser',
    components: {JSelectBizComponent},
    props: {
      value: null, // any type
      queryConfig: {
        type: Array,
        default: () => []
      },
       backInfo:{
        type: Object,
        default: ()=>{return  {value:'username',text:'realname'}},
        require:false,
      },
    },
    data() {
      return {
        url: { list: '/upms/user/selUserList' },
        columns: [
          { title: '姓名', align: 'center', width: '50%', widthRight: '70%', dataIndex: 'realname' },
          { title: '账号', align: 'center', width: '50%', dataIndex: 'username' },
        
        ],
        // 定义在这里的参数都是可以在外部传递覆盖的，可以更灵活的定制化使用的组件
        default: {
          name: '用户',
          width: 1200,
          displayKey: 'realname',
          returnKeys: [ 'id','username'],
          queryParamText: '用户查询',
          queryParamCode:'keyword',
          selectButtonText:'用户选择',
          placeholder:'请选择用户',
          backInfo:this.backInfo,
        },
        // 多条件查询配置
        queryConfigDefault: [
          
        ],
        selectComponentVisible:true,
      }
    },
    computed: {
      attrs() {
        return Object.assign(this.default, this.$attrs, {
          queryConfig: this.queryConfigDefault.concat(this.queryConfig)
        })
      }
    },
    methods:{
       openModal(){
        this.selectComponentVisible=false
        this.selectComponentVisible=true

        this.$nextTick(res=>{
            this.$refs.selectComponent.openModal()


        })
        
      },
    },
  }
</script>

<style lang="less" scoped></style>